Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@remixproject/plugin
Advanced tools
This is the core library used to create a new external plugin.
Name | Latest Version |
---|---|
@remixproject/plugin |
Use this library if you want to create a plugin for a new environment.
If you want to create a plugin in an existing envrionment, use the specific library. For example :
API | Description |
---|---|
PluginClient | Entry point to communicate with other plugins |
This getting started is for building iframe based plugin (only supported by remix-ide for now).
Installation :
npm install @remixproject/plugin-iframe
or with a unpkg :
<script src="https://unpkg.com/@remixproject/plugin"></script>
The plugin client is how you connect your plugin to remix.
To import ( the ES6 way) with NPM use:
import { createClient } from '@remixproject/plugin'
const client = createClient()
Or if you are using unpkg use:
const { createClient } = remixPlugin
const client = createClient()
To test your plugin with remix:
You can test your plugin direcly on the alpha version of Remix-IDE. Go to the pluginManager
(plug icon in the sidebar), and click "Connect to a Local Plugin".
Here you can add :
Note: No need to do anything if you localhost auto-reload, a new
handshake
will be send by the IDE.
Every plugin has a status object that can display notifications on the IDE. You can listen on a change of status from any plugin using statusChanged
event :
client.on('fileManager', 'statusChanged', (status: Status) => {
// Do Something
})
The status object is used for displaying a notification. It looks like that :
interface Status {
key: number | 'edited' | 'succeed' | 'loading' | 'failed' | 'none' // Display an icon or number
type?: 'success' | 'info' | 'warning' | 'error' // Bootstrap css color
title?: string // Describe the status on mouseover
}
'none'
value for key
.You can also change the status of your own plugin by emitting the same event :
client.emit('statusChanged', { key: 'succeed', type: 'success', title: 'Documentation ready !' })
The IDE can use this status to display a notification to the user.
Remix is using Bootstrap. For better User Experience it's highly recommanded to use the same theme as Remix in your plugin. For that you just have to use standard bootstrap classes.
Remix will automatically create a <link/>
tag in the header of your plugin with the current theme used. And it'll update the link each time the user change the theme.
If you really want to use your own theme, you can use the customTheme
flag in the option :
const client = createClient({ customTheme: true })
By default @remixproject/plugin
will use remix IDE api.
If you want to extends the API you can specify it in the customApi
option.
A good use case is when you want to use an external plugin not maintained by Remix team (3box plugin for example):
import { remixProfiles, IRemixApi } from '@remixproject/plugin'
interface ICustomApi extends IRemixApi {
box: IBox;
}
export type CustomApi = Readonly<ICustomApi>;
export type RemixClient = PluginClient<any, CustomApi> & PluginApi<CustomApi>;
const customApi: ProfileMap<RemixIDE> = Object.freeze({
...remixProfiles,
box: boxProfile
});
const client = createClient({ customApi })
You'll need Typescript > 3.4 to leverage the types.
Plugins communicate with the IDE through the postMessage
API. It means that PluginClient
needs to know the origin of your IDE.
If you're developing a plugin with your IDE running on localhost
you'll need to specify the port on which your IDE runs. By default the port used is 8080. To change it you can do:
const devMode = { port: 3000 }
const client = createClient({ devMode })
FAQs
This is the core library used to create a new external plugin.
The npm package @remixproject/plugin receives a total of 0 weekly downloads. As such, @remixproject/plugin popularity was classified as not popular.
We found that @remixproject/plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.